By any chance is there a way to refresh a single object at a time, such as running a script in attribute DXL and having that value update the object in the current module? As I've read a number of times in this forum, it seems that one has to scroll through the module to update the individual object contents after a Refresh DXL Attributes or similar function. |
Re: Refresh objects not module?
When you say 'refresh' this post assumes you mean 'force re-calculation of the attribute DXL for all objects in the module'.
//*************************
void fRefreshDxlAttrs(Object obj)
{ // Refresh all the DXL attributes for the specified Object
if (null obj) return()
if (isDeleted(obj) and
length(doorsInfo(infoVersion)) >=7 and
(doorsInfo(infoVersion))[0:6] == "9.2.0.1") return() // DOORS version 9.2.0.1 bug
Module mod = module(obj)
if (null mod) return() // is this possible?
AttrDef ad
noError()
for ad in mod do
{ if (ad.dxl and
ad.object) obj.(ad.name) = ""
}
lastError() // ignore all errors herein
} // end fRefreshDxlAttrs(Object)
//*************************
void fRefreshDxlAttrs(Module mod)
{ // Refresh all the DXL attributes in the Module
// Developer's note: the "for ad in mod do" loop is very slow,
// so this function does NOT loop through objects and call the
// above fRefreshDxlAttrs(Object) function (which loops through attrs).
// Instead, it first loops through attrs and then through objects.
if (null mod) return
bool Is9201 = length(doorsInfo(infoVersion)) >=7 and
(doorsInfo(infoVersion))[0:6] == "9.2.0.1"
string NameAttr
Object obj
AttrDef ad
noError()
for ad in mod do
{ if (!ad.dxl) continue
NameAttr = ad.name
if ( ad.object )
{
for obj in entire mod do
{ if (Is9201 and isDeleted(obj)) continue // Cannot update deleted object in v9.2.0.1
obj.NameAttr = ""
}
}
if (ad.module)
{
mod.NameAttr = ""
}
}
lastError() // ignore all errors herein
refresh(mod)
} // end fRefreshDxlAttrs(Module)
string Results = calculate the results for this 'obj'. if (null Results) // then obj.attrDXLName = " " else obj.attrDXLName = Results
string AttrValue = objOther.NameSomeOtherAttrDXL if (null AttrValue or AttrValue == " ") // then deal with null value else deal with a real value
|